package com.handinfo.android.ui.window;

import java.io.DataInputStream;
import java.io.IOException;

import android.graphics.Bitmap;
import android.widget.Toast;

import com.handinfo.android.DWGameManager;
import com.handinfo.android.game.Loading;
import com.handinfo.android.game.Login;
import com.handinfo.android.ui.IUIWindows;
import com.handinfo.android.ui.UIWindows;
import com.handinfo.android.uicontrols.DWControlTools;
import com.handinfo.android.uicontrols.DWControlsManager;
import com.handinfo.android.uicontrols.DWListener;
import com.handinfo.android.uicontrols.controls.DWBackground;
import com.handinfo.android.uicontrols.controls.DWButton;
import com.handinfo.android.uicontrols.controls.DWFrame;
import com.handinfo.android.uicontrols.controls.DWImageBox;
import com.handinfo.android.uicontrols.controls.DWMessageBox;
import com.handinfo.android.uicontrols.controls.DWSlider;
import com.handinfo.android.uicontrols.controls.DWTabControl;
import com.handinfo.android.uicontrols.controls.DWTabPage;
import com.handinfo.android.uicontrols.controls.DWTextbox;
import com.handinfo.android.uicontrols.controls.DWTitle;
//import com.handinfo.android.utils.ChannelOperation;
import com.handinfo.android.utils.Tools;

/**
 *
 * 设置界面
 *
 * @author mujianchen
 *
 */

public class UISetup implements IUIWindows
{
	public DWFrame m_stFrame = null;
	public DWTitle m_stTitle01 = null;
	public DWTitle m_stTitle02 = null;

	public Bitmap m_stBitmap01 = null;
	public Bitmap m_stBitmap02 = null;
	public Bitmap m_stBitmap03 = null;
	public Bitmap m_stBitmap04 = null;
	public Bitmap m_stBitmap05 = null;
//	public Bitmap m_stBitmap06 = null;
	public Bitmap m_stBitmap_bj = null;
	public Bitmap m_stBitmap_BT = null;

	public DWTabPage m_stTabPage02 = null;//系统
	public String m_stString01 = "服务";
	public String m_stString02 = "系统";
	public String m_stString03 = "画面";

	public DWImageBox m_stImageBox01 = null;
	public DWImageBox m_stImageBox_BT = null;
	public DWImageBox m_stImageBox_BT01 = null;

	public DWTextbox m_stLabel01 = null;
	public DWTextbox m_stLabel02 = null;
	public DWTextbox m_stLabel03 = null;
	public DWTextbox m_stLabel04 = null;
	public DWTextbox m_stLabel05 = null;
	public DWTextbox m_stLabel06 = null;
	public DWTextbox m_stLabel07 = null;

	//标签选项
	public DWTabControl m_stTabControl01 = null;
	public DWTabControl m_stTabControl02 = null;
	public Bitmap m_stBitmapTab01 = null;
	public Bitmap m_stBitmapTab02 = null;

	//设置按钮
	public DWButton m_stButton01 = null;
	public DWButton m_stButton02 = null;
	public DWButton m_stButton03 = null;
	public DWButton m_stButton04 = null;
	public DWButton m_stButton05 = null;
	public DWButton m_stButton06 = null;
	public DWButton m_stButton07 = null;
	public DWButton m_stButton08 = null;
	public DWButton m_stButton09 = null;
	public DWButton m_stButton10 = null;
//	public DWButton m_stButton11 = null;
	public DWButton m_stButton12 = null;
	public DWButton m_stButton13 = null;
	public DWButton m_stButton14 = null;
	public DWButton m_stButton15 = null;
	public DWButton m_stButton16 = null;
	public DWButton m_stButton18 = null;
	public DWButton m_stButton21 = null;
	public DWButton m_stButton22 = null;
	public DWButton m_stButton23 = null;
	public DWButton m_stButton24 = null;
	public DWButton m_stButton25 = null;
	public DWButton m_stButton26 = null;

	public DWButton m_stButton_sdk = null; //sdk进入社区

	public DWButton m_stButtonBack = null;

	//背景
	public DWBackground m_stBackground01 = null;
	public DWBackground m_stBackground02 = null;

	//设置界面状态
	public int state = 0;

//	public int m_tabindex;//标签索引

	public DWTabPage m_stTabPage03 = null;//服务
	public DWTabPage m_stTabPage04 = null;//系统
	public DWTabPage m_stTabPage05 = null;//画面

	//画面界面控件
	public DWTextbox m_hmTextbox01 = null;
	public DWTextbox m_hmTextbox02 = null;
	public DWTextbox m_hmTextbox03 = null;
	public DWTextbox m_hmTextbox04 = null;
	public DWTextbox m_hmTextbox05 = null;

	//滚动条
	public DWSlider m_stSlider = null;
	public Bitmap m_stBitmap_Slider_L = null;
	public Bitmap m_stBitmap_Slider_S = null;

	public DWButton m_hmButton01 = null;
	public DWButton m_hmButton02 = null;
	public DWButton m_hmButton03 = null;
	public DWButton m_hmButton04 = null;
	public DWButton m_hmButton05 = null;
	public DWButton m_hmButton06 = null;
	public DWButton m_hmButton07 = null;
	public DWButton m_hmButton08 = null;
	public DWButton m_hmButton09 = null;
	public DWButton m_hmButton10 = null;
	public DWButton m_hmButton11 = null;
	public void init()
	{
		m_stBitmap01 = UIWindows.createImage("/img/newui/fanhuianniu_1.gnp");//关闭图片
		m_stBitmap02 = UIWindows.createImage("/img/newui/anniu_2.gnp");//按钮图片开
		m_stBitmap03 = UIWindows.createImage("/img/newui/anniu_2ax.gnp");//按钮图片关
		m_stBitmap04 = UIWindows.createImage("/img/newui/anniu_6.gnp");//保存修改按钮
		m_stBitmap05 = UIWindows.createImage("/img/newui/anniu_6ax.gnp");//按下
//		m_stBitmap06 = UIWindows.createImage("/img/newui/anniu_6.gnp");//按下
		m_stBitmap_bj = UIWindows.createImage("/img/newui/denglubjt_1.gnp");//大背景

		m_stBitmap_Slider_L = UIWindows.createImage("/img/newui/huadongtiaod_1.gnp");//滚动条背景
		m_stBitmap_Slider_S = UIWindows.createImage("/img/newui/huadongtiaok_1.gnp");//滚动条滑块

		m_stBitmap_BT = UIWindows.createImage("/img/newui/youxishezhi_1.gnp");//标题

		m_stBitmapTab01 = UIWindows.createImage("/img/newui/biaoqianye_1.gnp");//标签页选项
		m_stBitmapTab02 = UIWindows.createImage("/img/newui/biaoqianye_2.gnp");//标签页选项
	}

	public void setup()
	{
		if (m_stFrame != null) {
			DWControlsManager.getInstance().removeControl(m_stFrame);
		}
		switch (state)
		{
			case 0:
				m_stFrame = new DWFrame(DWGameManager.Screen_Width, DWGameManager.Screen_Height);

				m_stBackground02 = new DWBackground(m_stBitmap_bj, 0, 0, m_stFrame.getShowWidth(),
						m_stFrame.getShowHeight());

				m_stBackground01 = new DWBackground(m_stFrame.getShowWidth() - 50,
						m_stFrame.getShowHeight() - 100);
				m_stBackground01.setNearAnchor(m_stFrame, Tools.HCENTER_VCENTER, Tools.HCENTER_VCENTER, 0, 0);

				m_stTitle01 = new DWTitle(null, m_stFrame);
				m_stTitle01.setNearAnchor(m_stBackground01, Tools.LEFT_BOTTOM, Tools.LEFT_TOP);
				m_stTitle01.setShowWideHigh(m_stBackground01.getShowWidth(), m_stTitle01.getShowHeight());

				m_stImageBox_BT01 = new DWImageBox(m_stBitmap_BT);
				m_stImageBox_BT01.setNearAnchor(m_stTitle01, Tools.HCENTER_VCENTER, Tools.HCENTER_VCENTER);

				m_stButtonBack = new DWButton("返回登录", m_stBitmap04);
				m_stButtonBack.setDownImage(m_stBitmap05);
				m_stButtonBack.addListener(m_back_lis);
				m_stButtonBack.setNearAnchor(m_stFrame, Tools.LEFT_BOTTOM, Tools.LEFT_BOTTOM, 30, -30);

				m_stTabControl01 = new DWTabControl(m_stBitmapTab01, m_stBitmapTab02,
						m_stBackground01.getShowWidth() - 30,
						m_stBackground01.getShowHeight() - 40);
				m_stTabControl01.setNearAnchor(m_stTitle01, Tools.HCENTER_TOP, Tools.HCENTER_BOTTOM);
				//标签页内容
				m_stTabPage02 = new DWTabPage();
				m_stTabPage02.setName(m_stString02);

				//标签
				m_stLabel01 = new DWTextbox("世界频道");
				m_stLabel02 = new DWTextbox("家族频道");
				m_stLabel03 = new DWTextbox("队伍频道");
				m_stLabel04 = new DWTextbox("私聊频道");
				m_stLabel05 = new DWTextbox("阵营频道");
				m_stLabel06 = new DWTextbox("游戏音乐");
				m_stLabel07 = new DWTextbox("游戏音效");

				//设置按钮
				m_stButton01 = new DWButton("开启", m_stBitmap02);
				m_stButton02 = new DWButton("关闭", m_stBitmap03);
				m_stButton03 = new DWButton("开启", m_stBitmap02);
				m_stButton04 = new DWButton("关闭", m_stBitmap03);
				m_stButton05 = new DWButton("开启", m_stBitmap02);
				m_stButton06 = new DWButton("关闭", m_stBitmap03);
				m_stButton07 = new DWButton("开启", m_stBitmap02);
				m_stButton08 = new DWButton("关闭", m_stBitmap03);

				m_stButton09 = new DWButton("开启", m_stBitmap02);
				m_stButton10 = new DWButton("关闭", m_stBitmap03);
//				m_stButton11 = new DWButton("最低", m_stBitmap03);
				m_stButton12 = new DWButton("开启", m_stBitmap02);
				m_stButton13 = new DWButton("关闭", m_stBitmap03);
				m_stButton14 = new DWButton("开启", m_stBitmap02);
				m_stButton15 = new DWButton("关闭", m_stBitmap03);

				switch (DWGameManager.AdpaterType) {
					case DWGameManager.AD_HIGH:
						m_stLabel01.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, -450, 30);
						m_stLabel02.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, -450, 130);
						m_stLabel03.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, -450, 230);
						m_stLabel04.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, -450, 330);
						m_stLabel05.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 50, 30);
						m_stLabel06.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 50, 130);
						m_stLabel07.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 50, 230);

						m_stButton01.setNearAnchor(m_stLabel01, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton02.setNearAnchor(m_stButton01, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton03.setNearAnchor(m_stLabel02, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton04.setNearAnchor(m_stButton03, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton05.setNearAnchor(m_stLabel03, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton06.setNearAnchor(m_stButton05, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton07.setNearAnchor(m_stLabel04, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton08.setNearAnchor(m_stButton07, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton09.setNearAnchor(m_stLabel05, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton10.setNearAnchor(m_stButton09, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton12.setNearAnchor(m_stLabel06, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton13.setNearAnchor(m_stButton12, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton14.setNearAnchor(m_stLabel07, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton15.setNearAnchor(m_stButton14, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						break;
					default:
						m_stLabel01.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, -300, 30);
						m_stLabel02.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, -300, 90);
						m_stLabel03.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, -300, 150);
						m_stLabel04.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, -300, 210);
						m_stLabel05.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 20, 30);
						m_stLabel06.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 20, 90);
						m_stLabel07.setNearAnchor(m_stTabPage02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 20, 150);

						m_stButton01.setNearAnchor(m_stLabel01, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton02.setNearAnchor(m_stButton01, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton03.setNearAnchor(m_stLabel02, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton04.setNearAnchor(m_stButton03, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton05.setNearAnchor(m_stLabel03, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton06.setNearAnchor(m_stButton05, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton07.setNearAnchor(m_stLabel04, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton08.setNearAnchor(m_stButton07, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton09.setNearAnchor(m_stLabel05, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton10.setNearAnchor(m_stButton09, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton12.setNearAnchor(m_stLabel06, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton13.setNearAnchor(m_stButton12, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton14.setNearAnchor(m_stLabel07, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						m_stButton15.setNearAnchor(m_stButton14, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 20, 0);
						break;
				}

				m_stButton01.addListener(m_stBp01);
				m_stButton02.addListener(m_stBp02);
				m_stButton03.addListener(m_stBp03);
				m_stButton04.addListener(m_stBp04);
				m_stButton05.addListener(m_stBp05);
				m_stButton06.addListener(m_stBp06);
				m_stButton07.addListener(m_stBp07);
				m_stButton08.addListener(m_stBp08);
				m_stButton09.addListener(m_stBp09);
				m_stButton10.addListener(m_stBp10);
//				m_stButton11.addListener(m_stBp11);
				m_stButton12.addListener(m_stBp12);
				m_stButton13.addListener(m_stBp13);
				m_stButton14.addListener(m_stBp14);
				m_stButton15.addListener(m_stBp15);

				//保存修改按钮
				m_stButton16 = new DWButton("保存修改", m_stBitmap04);
				m_stButton16.setDownImage(m_stBitmap05);
				m_stButton16.setNearAnchor(m_stTabPage02, Tools.RIGHT_BOTTOM, Tools.RIGHT_BOTTOM, -40, -20);
				m_stButton16.addListener(m_stBp16_01);

				//修复游戏按钮
				m_stButton18 = new DWButton("修复游戏", m_stBitmap04);
				m_stButton18.setDownImage(m_stBitmap05);
				m_stButton18.setNearAnchor(m_stTabPage02, Tools.RIGHT_BOTTOM, Tools.RIGHT_BOTTOM, -230, -20);
				m_stButton18.addListener(m_stBp18);

				m_stFrame.addControl(m_stBackground02);
				m_stFrame.addControl(m_stBackground01);
				m_stFrame.addControl(m_stTitle01);
				m_stFrame.addControl(m_stImageBox_BT01);
				//图片
				m_stFrame.addControl(m_stButtonBack);
				m_stFrame.addControl(m_stTabControl01);

				m_stTabPage02.addControls(m_stLabel01);
				m_stTabPage02.addControls(m_stLabel02);
				m_stTabPage02.addControls(m_stLabel03);
				m_stTabPage02.addControls(m_stLabel04);
				m_stTabPage02.addControls(m_stLabel05);
				m_stTabPage02.addControls(m_stLabel06);
				m_stTabPage02.addControls(m_stLabel07);

				m_stTabPage02.addControls(m_stButton01);
				m_stTabPage02.addControls(m_stButton02);
				m_stTabPage02.addControls(m_stButton03);
				m_stTabPage02.addControls(m_stButton04);
				m_stTabPage02.addControls(m_stButton05);
				m_stTabPage02.addControls(m_stButton06);
				m_stTabPage02.addControls(m_stButton07);
				m_stTabPage02.addControls(m_stButton08);
				m_stTabPage02.addControls(m_stButton09);
				m_stTabPage02.addControls(m_stButton10);
//				m_stTabPage02.addControls(m_stButton11);
				m_stTabPage02.addControls(m_stButton12);
				m_stTabPage02.addControls(m_stButton13);
				m_stTabPage02.addControls(m_stButton14);
				m_stTabPage02.addControls(m_stButton15);
//				m_stTabPage02.addControls(m_stButton16);//保存修改
//				m_stTabPage02.addControls(m_stButton18);
				m_stTabControl01.addTabPage(m_stTabPage02);
				break;
			case 1:
				m_stFrame = new DWFrame(DWFrame.FRAME_TYPE_FULL, true);
				m_stTitle02 = new DWTitle(null, m_stFrame);

				m_flag_setup = true;

				m_stImageBox_BT = new DWImageBox(m_stBitmap_BT);
				m_stImageBox_BT.setNearAnchor(m_stTitle02, Tools.HCENTER_VCENTER, Tools.HCENTER_VCENTER);

				m_stImageBox01 = new DWImageBox(m_stBitmap01);
				m_stImageBox01.addListener(new DWListener() {

					public void OnDoubleClick()
					{

					}

					public void OnClick()
					{
						close((byte) 0);
					}
				});
				m_stImageBox01.setNearAnchor(m_stTitle02, Tools.RIGHT_VCENTER, Tools.RIGHT_VCENTER);
				m_stImageBox01.setTouchZoomIn(20, 20);

				m_stTabControl02 = new DWTabControl(m_stBitmapTab01, m_stBitmapTab02, m_stFrame.getShowWidth() - 30,
						m_stFrame.getShowHeight() - 40);
				m_stTabControl02.setNearAnchor(m_stTitle02, Tools.HCENTER_TOP, Tools.HCENTER_BOTTOM);

				m_stTabControl02.addListener(new DWListener() {

					public void OnDoubleClick()
					{

					}

					public void OnClick()
					{
						int index = m_stTabControl02.getPageIndex();
						switch (index)
						{
							case 0:
								Tools.debugPrintln("-------->服务");
								break;
							case 1:
								Tools.debugPrintln("-------->系统");
								DWGameManager.getSetting_system(DWGameManager.设置系统_世界频道);
								DWGameManager.getSetting_system(DWGameManager.设置系统_家族频道);
								DWGameManager.getSetting_system(DWGameManager.设置系统_队伍频道);
								DWGameManager.getSetting_system(DWGameManager.设置系统_私聊频道);
								DWGameManager.getSetting_system(DWGameManager.设置系统_阵营频道);
								DWGameManager.getSetting_system(DWGameManager.设置系统_游戏音乐);
								DWGameManager.getSetting_system(DWGameManager.设置系统_游戏音效);
								break;
							case 2:
								Tools.debugPrintln("-------->画面");
								DWGameManager.getSetting_graphics(DWGameManager.设置画面_显示敌方玩家);
								DWGameManager.getSetting_graphics(DWGameManager.设置画面_显示友方玩家);
								DWGameManager.getSetting_graphics(DWGameManager.设置画面_显示其他玩家名称);
								DWGameManager.getSetting_graphics(DWGameManager.设置画面_显示其他玩家特效);
								DWGameManager.getSetting_light();
								break;
						}
					}
				});

				m_stBackground01 = new DWBackground(m_stFrame.getShowWidth() - 20,
						m_stFrame.getShowHeight() - 40 - m_stBitmapTab01.getHeight());
				m_stBackground01.setNearAnchor(m_stTitle02, Tools.HCENTER_TOP, Tools.HCENTER_BOTTOM, 0, m_stBitmapTab01
						.getHeight());

				for (int i = 0; i < 3; i++)
				{
					switch (i)
					{
						case 0:
							m_stTabPage03 = new DWTabPage();
							m_stTabPage03.setName(m_stString01);

							m_stButton21 = new DWButton("脱离卡死", m_stBitmap04);
							m_stButton22 = new DWButton("游戏帮助", m_stBitmap04);
							m_stButton23 = new DWButton("游戏公告", m_stBitmap04);
							m_stButton24 = new DWButton("切换角色", m_stBitmap04);
							m_stButton25 = new DWButton("退出游戏", m_stBitmap04);
							m_stButton26 = new DWButton("联系客服", m_stBitmap04);
							//注释掉。。
//							ChannelOperation.addButtonSheQu(m_stTabPage03, m_stBitmap04, m_stBitmap05);

							m_stButton21.setDownImage(m_stBitmap05);
							m_stButton22.setDownImage(m_stBitmap05);
							m_stButton23.setDownImage(m_stBitmap05);
							m_stButton24.setDownImage(m_stBitmap05);
							m_stButton25.setDownImage(m_stBitmap05);
							m_stButton26.setDownImage(m_stBitmap05);

							m_stButton21.setNearAnchor(m_stTabPage03, Tools.HCENTER_VCENTER, Tools.LEFT_TOP,
									m_stTabControl02.getShowWidth() / 4, m_stTabControl02.getShowHeight() / 4);
							m_stButton22.setNearAnchor(m_stTabPage03, Tools.HCENTER_VCENTER, Tools.HCENTER_TOP, 0,
									m_stTabControl02.getShowHeight() / 4);
							m_stButton23.setNearAnchor(m_stTabPage03, Tools.HCENTER_VCENTER, Tools.RIGHT_TOP,
									-(m_stTabControl02.getShowWidth() / 4), m_stTabControl02.getShowHeight() / 4);
							m_stButton26.setNearAnchor(m_stTabPage03, Tools.HCENTER_VCENTER, Tools.LEFT_BOTTOM,
									m_stTabControl02.getShowWidth() / 4, -(m_stTabControl02.getShowHeight() / 4));
							m_stButton24.setNearAnchor(m_stTabPage03, Tools.HCENTER_VCENTER, Tools.HCENTER_BOTTOM, 0,
									-(m_stTabControl02.getShowHeight() / 4));
							m_stButton25.setNearAnchor(m_stTabPage03, Tools.HCENTER_VCENTER, Tools.RIGHT_BOTTOM,
									-(m_stTabControl02.getShowWidth() / 4),
									-(m_stTabControl02.getShowHeight() / 4));

							m_stButton21.addListener(m_stBp21);
							m_stButton22.addListener(m_stBp22);
							m_stButton23.addListener(m_stBp23);
							m_stButton24.addListener(m_stBp24);
							m_stButton25.addListener(m_stBp25);
							m_stButton26.addListener(m_stBp26);

							m_stTabPage03.addControls(m_stButton21);
							m_stTabPage03.addControls(m_stButton22);
							m_stTabPage03.addControls(m_stButton23);
							m_stTabPage03.addControls(m_stButton24);
							m_stTabPage03.addControls(m_stButton25);
							m_stTabPage03.addControls(m_stButton26);
							m_stTabControl02.addTabPage(m_stTabPage03);
							break;

						case 1:
							m_stTabPage04 = new DWTabPage();
							m_stTabPage04.setName(m_stString02);

							//标签
							m_stLabel01 = new DWTextbox("世界频道");
							m_stLabel02 = new DWTextbox("家族频道");
							m_stLabel03 = new DWTextbox("队伍频道");
							m_stLabel04 = new DWTextbox("私聊频道");
							m_stLabel05 = new DWTextbox("阵营频道");
							m_stLabel06 = new DWTextbox("游戏音乐");
							m_stLabel07 = new DWTextbox("游戏音效");

							//设置按钮
							m_stButton01 = new DWButton("开启", m_stBitmap02);
							m_stButton02 = new DWButton("关闭", m_stBitmap03);
							m_stButton03 = new DWButton("开启", m_stBitmap02);
							m_stButton04 = new DWButton("关闭", m_stBitmap03);
							m_stButton05 = new DWButton("开启", m_stBitmap02);
							m_stButton06 = new DWButton("关闭", m_stBitmap03);
							m_stButton07 = new DWButton("开启", m_stBitmap02);
							m_stButton08 = new DWButton("关闭", m_stBitmap03);

							m_stButton09 = new DWButton("开启", m_stBitmap02);
							m_stButton10 = new DWButton("关闭", m_stBitmap03);
//							m_stButton11 = new DWButton("最低", m_stBitmap03);
							m_stButton12 = new DWButton("开启", m_stBitmap02);
							m_stButton13 = new DWButton("关闭", m_stBitmap03);
							m_stButton14 = new DWButton("开启", m_stBitmap02);
							m_stButton15 = new DWButton("关闭", m_stBitmap03);

							switch (DWGameManager.AdpaterType) {
								case DWGameManager.AD_HIGH:
									m_stLabel01.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP,
											-450, 50);
									m_stLabel02.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP,
											-450, 150);
									m_stLabel03.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP,
											-450, 250);
									m_stLabel04.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP,
											-450, 350);
									m_stLabel05.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 50,
											50);
									m_stLabel06.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 50,
											150);
									m_stLabel07.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 50,
											250);

									m_stButton01.setNearAnchor(m_stLabel01, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton02.setNearAnchor(m_stButton01, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton03.setNearAnchor(m_stLabel02, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton04.setNearAnchor(m_stButton03, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton05.setNearAnchor(m_stLabel03, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton06.setNearAnchor(m_stButton05, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton07.setNearAnchor(m_stLabel04, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton08.setNearAnchor(m_stButton07, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton09.setNearAnchor(m_stLabel05, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton10.setNearAnchor(m_stButton09, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton12.setNearAnchor(m_stLabel06, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton13.setNearAnchor(m_stButton12, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton14.setNearAnchor(m_stLabel07, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									m_stButton15.setNearAnchor(m_stButton14, Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER,
											20, 0);
									break;
								default:
									m_stLabel01.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP,
											-300, 30);
									m_stLabel02.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP,
											-300, 90);
									m_stLabel03.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP,
											-300, 150);
									m_stLabel04.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP,
											-300, 210);
									m_stLabel05.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 20,
											30);
									m_stLabel06.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 20,
											90);
									m_stLabel07.setNearAnchor(m_stTabPage04, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 20,
											150);

									m_stButton01.setNearAnchor(m_stLabel01, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 105,
											0);
									m_stButton02.setNearAnchor(m_stLabel01, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 200,
											0);
									m_stButton03.setNearAnchor(m_stLabel02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 105,
											0);
									m_stButton04.setNearAnchor(m_stLabel02, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 200,
											0);
									m_stButton05.setNearAnchor(m_stLabel03, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 105,
											0);
									m_stButton06.setNearAnchor(m_stLabel03, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 200,
											0);
									m_stButton07.setNearAnchor(m_stLabel04, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 105,
											0);
									m_stButton08.setNearAnchor(m_stLabel04, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 200,
											0);
									m_stButton09.setNearAnchor(m_stLabel05, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 105,
											0);
									m_stButton10.setNearAnchor(m_stLabel05, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 200,
											0);
//									m_stButton11.setNearAnchor(m_stLabel05, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 295, 0);
									m_stButton12.setNearAnchor(m_stLabel06, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 105,
											0);
									m_stButton13.setNearAnchor(m_stLabel06, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 200,
											0);
									m_stButton14.setNearAnchor(m_stLabel07, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 105,
											0);
									m_stButton15.setNearAnchor(m_stLabel07, Tools.HCENTER_TOP, Tools.HCENTER_TOP, 200,
											0);
									break;
							}

							m_stButton01.addListener(m_stBp01);
							m_stButton02.addListener(m_stBp02);
							m_stButton03.addListener(m_stBp03);
							m_stButton04.addListener(m_stBp04);
							m_stButton05.addListener(m_stBp05);
							m_stButton06.addListener(m_stBp06);
							m_stButton07.addListener(m_stBp07);
							m_stButton08.addListener(m_stBp08);
							m_stButton09.addListener(m_stBp09);
							m_stButton10.addListener(m_stBp10);
//							m_stButton11.addListener(m_stBp11);
							m_stButton12.addListener(m_stBp12);
							m_stButton13.addListener(m_stBp13);
							m_stButton14.addListener(m_stBp14);
							m_stButton15.addListener(m_stBp15);

							//保存修改按钮
							m_stButton16 = new DWButton("保存修改", m_stBitmap04);
							m_stButton16.setDownImage(m_stBitmap05);
							m_stButton16.setNearAnchor(m_stTabPage04, Tools.RIGHT_BOTTOM,
									Tools.RIGHT_BOTTOM, -40, -40);
							m_stButton16.addListener(m_stBp16);

							m_stTabPage04.addControls(m_stLabel01);
							m_stTabPage04.addControls(m_stLabel02);
							m_stTabPage04.addControls(m_stLabel03);
							m_stTabPage04.addControls(m_stLabel04);
							m_stTabPage04.addControls(m_stLabel05);
							m_stTabPage04.addControls(m_stLabel06);
							m_stTabPage04.addControls(m_stLabel07);

							m_stTabPage04.addControls(m_stButton01);
							m_stTabPage04.addControls(m_stButton02);
							m_stTabPage04.addControls(m_stButton03);
							m_stTabPage04.addControls(m_stButton04);
							m_stTabPage04.addControls(m_stButton05);
							m_stTabPage04.addControls(m_stButton06);
							m_stTabPage04.addControls(m_stButton07);
							m_stTabPage04.addControls(m_stButton08);
							m_stTabPage04.addControls(m_stButton09);
							m_stTabPage04.addControls(m_stButton10);
//							m_stTabPage04.addControls(m_stButton11);
							m_stTabPage04.addControls(m_stButton12);
							m_stTabPage04.addControls(m_stButton13);
							m_stTabPage04.addControls(m_stButton14);
							m_stTabPage04.addControls(m_stButton15);
//							m_stTabPage04.addControls(m_stButton16);//保存修改
							m_stTabControl02.addTabPage(m_stTabPage04);
							break;
						case 2:
							m_stTabPage05 = new DWTabPage();
							m_stTabPage05.setName(m_stString03);

							m_hmTextbox01 = new DWTextbox("显示敌方玩家（省流量）");
							m_hmTextbox02 = new DWTextbox("显示友方玩家（省流量）");
							m_hmTextbox03 = new DWTextbox("其他玩家名称");
							m_hmTextbox04 = new DWTextbox("其他玩家战斗特效");

							m_stSlider = new DWSlider(m_stBitmap_Slider_L, m_stBitmap_Slider_S, 80);

							m_hmTextbox05 = new DWTextbox("屏幕亮度：" + (int) m_stSlider.getCurrentValue());

							m_stSlider.addListener(new DWListener() {

								public void OnDoubleClick()
								{

								}

								public void OnClick()
								{
									DWGameManager.setSetting_light((int) m_stSlider.getCurrentValue() + 20);
									m_hmTextbox05.setText("屏幕亮度：" + (int) m_stSlider.getCurrentValue() / 2);
								}
							});

							m_hmButton01 = new DWButton("显示", m_stBitmap02);
							m_hmButton02 = new DWButton("关闭", m_stBitmap03);
							m_hmButton03 = new DWButton("显示", m_stBitmap02);
							m_hmButton04 = new DWButton("关闭", m_stBitmap03);
							m_hmButton05 = new DWButton("显示", m_stBitmap02);
							m_hmButton06 = new DWButton("关闭", m_stBitmap03);
							m_hmButton07 = new DWButton("显示", m_stBitmap02);
							m_hmButton08 = new DWButton("关闭", m_stBitmap03);
//							m_hmButton09 = new DWButton("显示", m_stBitmap02);
//							m_hmButton10 = new DWButton("关闭", m_stBitmap03);
							m_hmButton11 = new DWButton("保存修改", m_stBitmap04);//保存修改

							m_hmButton11.setDownImage(m_stBitmap05);

							switch (DWGameManager.AdpaterType) {
								case DWGameManager.AD_HIGH:
									m_hmTextbox01.setNearAnchor(m_stTabPage05, Tools.LEFT_TOP, Tools.LEFT_TOP, 150, 50);
									m_hmTextbox02.setNearAnchor(m_hmTextbox01, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 100);
									m_hmTextbox03.setNearAnchor(m_hmTextbox02, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 100);
									m_hmTextbox04.setNearAnchor(m_hmTextbox03, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 100);
									m_hmTextbox05.setNearAnchor(m_hmTextbox04, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 100);

									m_stSlider.setNearAnchor(m_hmTextbox05, Tools.LEFT_VCENTER, Tools.LEFT_VCENTER,
											400, 0);

									m_hmButton01.setNearAnchor(m_hmTextbox01, Tools.LEFT_TOP, Tools.LEFT_TOP, 400, 0);
									m_hmButton02.setNearAnchor(m_hmButton01, Tools.LEFT_TOP, Tools.RIGHT_TOP, 20, 0);
									m_hmButton03.setNearAnchor(m_hmTextbox02, Tools.LEFT_TOP, Tools.LEFT_TOP, 400, 0);
									m_hmButton04.setNearAnchor(m_hmButton03, Tools.LEFT_TOP, Tools.RIGHT_TOP, 20, 0);
									m_hmButton05.setNearAnchor(m_hmTextbox03, Tools.LEFT_TOP, Tools.LEFT_TOP, 400, 0);
									m_hmButton06.setNearAnchor(m_hmButton05, Tools.LEFT_TOP, Tools.RIGHT_TOP, 20, 0);
									m_hmButton07.setNearAnchor(m_hmTextbox04, Tools.LEFT_TOP, Tools.LEFT_TOP, 400, 0);
									m_hmButton08.setNearAnchor(m_hmButton07, Tools.LEFT_TOP, Tools.RIGHT_TOP, 20, 0);
									m_hmButton11.setNearAnchor(m_stTabPage05, Tools.RIGHT_BOTTOM, Tools.RIGHT_BOTTOM,
											-40, -40);
									break;
								default:
									m_hmTextbox01.setNearAnchor(m_stTabPage05, Tools.LEFT_TOP, Tools.LEFT_TOP, 50, 50);
									m_hmTextbox02.setNearAnchor(m_hmTextbox01, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 60);
									m_hmTextbox03.setNearAnchor(m_hmTextbox02, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 60);
									m_hmTextbox04.setNearAnchor(m_hmTextbox03, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 60);
									m_hmTextbox05.setNearAnchor(m_hmTextbox04, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 60);

									m_stSlider.setNearAnchor(m_hmTextbox05, Tools.LEFT_VCENTER, Tools.LEFT_VCENTER,
											255, 0);

									m_hmButton01.setNearAnchor(m_hmTextbox01, Tools.LEFT_TOP, Tools.LEFT_TOP, 255, 0);
									m_hmButton02.setNearAnchor(m_hmTextbox01, Tools.LEFT_TOP, Tools.LEFT_TOP, 350, 0);
									m_hmButton03.setNearAnchor(m_hmTextbox02, Tools.LEFT_TOP, Tools.LEFT_TOP, 255, 0);
									m_hmButton04.setNearAnchor(m_hmTextbox02, Tools.LEFT_TOP, Tools.LEFT_TOP, 350, 0);
									m_hmButton05.setNearAnchor(m_hmTextbox03, Tools.LEFT_TOP, Tools.LEFT_TOP, 255, 0);
									m_hmButton06.setNearAnchor(m_hmTextbox03, Tools.LEFT_TOP, Tools.LEFT_TOP, 350, 0);
									m_hmButton07.setNearAnchor(m_hmTextbox04, Tools.LEFT_TOP, Tools.LEFT_TOP, 255, 0);
									m_hmButton08.setNearAnchor(m_hmTextbox04, Tools.LEFT_TOP, Tools.LEFT_TOP, 350, 0);
									m_hmButton11.setNearAnchor(m_stTabPage05, Tools.RIGHT_BOTTOM, Tools.RIGHT_BOTTOM,
											-40, -40);
									break;
							}

							m_hmButton01.addListener(m_hmBp01);
							m_hmButton02.addListener(m_hmBp02);
							m_hmButton03.addListener(m_hmBp03);
							m_hmButton04.addListener(m_hmBp04);
							m_hmButton05.addListener(m_hmBp05);
							m_hmButton06.addListener(m_hmBp06);
							m_hmButton07.addListener(m_hmBp07);
							m_hmButton08.addListener(m_hmBp08);
//							m_hmButton09.addListener(m_hmBp09);
//							m_hmButton10.addListener(m_hmBp10);
							m_hmButton11.addListener(m_stBp16);//保存监听

							m_stTabPage05.addControls(m_hmTextbox01);
							m_stTabPage05.addControls(m_hmTextbox02);
							m_stTabPage05.addControls(m_hmTextbox03);
							m_stTabPage05.addControls(m_hmTextbox04);
							m_stTabPage05.addControls(m_hmTextbox05);

							m_stTabPage05.addControls(m_hmButton01);
							m_stTabPage05.addControls(m_hmButton02);
							m_stTabPage05.addControls(m_hmButton03);
							m_stTabPage05.addControls(m_hmButton04);
							m_stTabPage05.addControls(m_hmButton05);
							m_stTabPage05.addControls(m_hmButton06);
							m_stTabPage05.addControls(m_hmButton07);
							m_stTabPage05.addControls(m_hmButton08);
//							m_stTabPage05.addControls(m_hmButton09);
//							m_stTabPage05.addControls(m_hmButton10);
							m_stTabPage05.addControls(m_stSlider);//滚动条
//							m_stTabPage05.addControls(m_hmButton11);//保存修改
							m_stTabControl02.addTabPage(m_stTabPage05);
							break;
					}
					m_stFrame.addControl(m_stTitle02);
					m_stFrame.addControl(m_stImageBox_BT);
					m_stFrame.addControl(m_stBackground01);

					//图片
					m_stFrame.addControl(m_stImageBox01);
					m_stFrame.addControl(m_stTabControl02);
				}
				break;
		}
		DWControlsManager.getInstance().addControl(m_stFrame);
	}

	////////////////////////////////////////////////////////
	//按键监听
	////////////////////////////////////////////////////////

	/**
	 * 世界频道 开
	 */
	private DWListener m_stBp01 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_世界频道, true);
			m_stButton01.setBackground(m_stBitmap02, false);
			m_stButton02.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 世界频道 关
	 */
	private DWListener m_stBp02 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_世界频道, false);
			m_stButton01.setBackground(m_stBitmap03, false);
			m_stButton02.setBackground(m_stBitmap02, false);
		}
	};

	/**
	 * 家族频道 开
	 */
	private DWListener m_stBp03 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_家族频道, true);
			m_stButton03.setBackground(m_stBitmap02, false);
			m_stButton04.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 家族频道 关
	 */
	private DWListener m_stBp04 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_家族频道, false);
			m_stButton03.setBackground(m_stBitmap03, false);
			m_stButton04.setBackground(m_stBitmap02, false);
		}
	};

	/**
	 * 队伍频道 开
	 */
	private DWListener m_stBp05 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_队伍频道, true);
			m_stButton05.setBackground(m_stBitmap02, false);
			m_stButton06.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 队伍频道 关
	 */
	private DWListener m_stBp06 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_队伍频道, false);
			m_stButton05.setBackground(m_stBitmap03, false);
			m_stButton06.setBackground(m_stBitmap02, false);
		}
	};

	/**
	 * 私聊频道 开
	 */
	private DWListener m_stBp07 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_私聊频道, true);
			m_stButton07.setBackground(m_stBitmap02, false);
			m_stButton08.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 私聊频道 关
	 */
	private DWListener m_stBp08 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_私聊频道, false);
			m_stButton07.setBackground(m_stBitmap03, false);
			m_stButton08.setBackground(m_stBitmap02, false);
		}
	};

	/**
	 * 阵营频道 开
	 */
	private DWListener m_stBp09 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_阵营频道, true);
			m_stButton09.setBackground(m_stBitmap02, false);
			m_stButton10.setBackground(m_stBitmap03, false);
//			m_stButton11.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 阵营频道 关
	 */
	private DWListener m_stBp10 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_阵营频道, false);
			m_stButton09.setBackground(m_stBitmap03, false);
			m_stButton10.setBackground(m_stBitmap02, false);
//			m_stButton11.setBackground(m_stBitmap03, false);
		}
	};
//
//	/**
//	 * 显示玩家 最低
//	 */
//	private DWListener m_stBp11 = new DWListener() {
//
//		public void OnDoubleClick()
//		{
//
//		}
//
//		public void OnClick()
//		{
//			m_stButton09.setBackground(m_stBitmap03, false);
//			m_stButton10.setBackground(m_stBitmap03, false);
//			m_stButton11.setBackground(m_stBitmap02, false);
//		}
//	};

	/**
	 * 游戏音乐 开
	 */
	private DWListener m_stBp12 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_游戏音乐, true);
			m_stButton12.setBackground(m_stBitmap02, false);
			m_stButton13.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 游戏音乐 关
	 */
	private DWListener m_stBp13 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_游戏音乐, false);
			m_stButton12.setBackground(m_stBitmap03, false);
			m_stButton13.setBackground(m_stBitmap02, false);
		}
	};

	/**
	 * 游戏音效 开
	 */
	private DWListener m_stBp14 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_游戏音效, true);
			m_stButton14.setBackground(m_stBitmap02, false);
			m_stButton15.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 游戏音效 关
	 */
	private DWListener m_stBp15 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_system(DWGameManager.设置系统_游戏音效, false);
			m_stButton14.setBackground(m_stBitmap03, false);
			m_stButton15.setBackground(m_stBitmap02, false);
		}
	};

	/**
	 * 显示敌方玩家 开
	 */
	private DWListener m_hmBp01 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示敌方玩家, true);
			m_hmButton01.setBackground(m_stBitmap02, false);
			m_hmButton02.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 显示敌方玩家 关
	 */
	private DWListener m_hmBp02 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示敌方玩家, false);
			m_hmButton01.setBackground(m_stBitmap03, false);
			m_hmButton02.setBackground(m_stBitmap02, false);
		}
	};

	/**
	 * 显示友方玩家 开
	 */
	private DWListener m_hmBp03 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示友方玩家, true);
			m_hmButton03.setBackground(m_stBitmap02, false);
			m_hmButton04.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 显示友方玩家 关
	 */
	private DWListener m_hmBp04 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示友方玩家, false);
			m_hmButton03.setBackground(m_stBitmap03, false);
			m_hmButton04.setBackground(m_stBitmap02, false);
		}
	};

	/**
	 * 显示其他玩家名称 开
	 */
	private DWListener m_hmBp05 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示其他玩家名称, true);
			m_hmButton05.setBackground(m_stBitmap02, false);
			m_hmButton06.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 显示其他玩家名称 关
	 */
	private DWListener m_hmBp06 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示其他玩家名称, false);
			m_hmButton05.setBackground(m_stBitmap03, false);
			m_hmButton06.setBackground(m_stBitmap02, false);
		}
	};

	/**
	 * 显示其他玩家特效 开
	 */
	private DWListener m_hmBp07 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示其他玩家特效, true);
			m_hmButton07.setBackground(m_stBitmap02, false);
			m_hmButton08.setBackground(m_stBitmap03, false);
		}
	};

	/**
	 * 显示其他玩家特效 关
	 */
	private DWListener m_hmBp08 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示其他玩家特效, false);
			m_hmButton07.setBackground(m_stBitmap03, false);
			m_hmButton08.setBackground(m_stBitmap02, false);
		}
	};

//	/**
//	 * 显示战斗信息 开
//	 */
//	private DWListener m_hmBp09 = new DWListener() {
//
//		public void OnDoubleClick()
//		{
//
//		}
//
//		public void OnClick()
//		{
//			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示战斗信息, true);
//			m_hmButton09.setBackground(m_stBitmap02, false);
//			m_hmButton10.setBackground(m_stBitmap03, false);
//		}
//	};
//
//	/**
//	 * 显示战斗信息 关
//	 */
//	private DWListener m_hmBp10 = new DWListener() {
//
//		public void OnDoubleClick()
//		{
//
//		}
//
//		public void OnClick()
//		{
//			DWGameManager.setSetting_graphics(DWGameManager.设置画面_显示战斗信息, false);
//			m_hmButton09.setBackground(m_stBitmap03, false);
//			m_hmButton10.setBackground(m_stBitmap02, false);
//		}
//	};

	/**
	 * 保存提示01
	 */
	public void tishi01()
	{
		final DWMessageBox mb = new DWMessageBox("提示", "您已经进行的修改保存吗？");
		mb.addListener(new DWListener() {
			public void OnDoubleClick()
			{
			}

			public void OnClick()
			{
				if (mb.getResult() == DWMessageBox.SOFTKEY_OK) {
					m_stFrame.removeControl(mb);
					Tools.debugPrintln("确定");
					DWGameManager.writeSettingToProperties(DWGameManager.PROPERTIES_DIR);
					DWGameManager.getInstance().showToast("您的修改已经保存。", Toast.LENGTH_SHORT);
				}
				else if (mb.getResult() == DWMessageBox.SOFTKEY_BACK) {
					m_stFrame.removeControl(mb);
					Tools.debugPrintln("返回");
				}
			}
		});
		m_stFrame.addControl(mb);
	}

	/**
	 * 保存提示02
	 */
	public void tishi02()
	{
		final DWMessageBox mb = new DWMessageBox("提示", "您已经进行的修改保存吗？");
		mb.addListener(new DWListener() {
			public void OnDoubleClick()
			{
			}

			public void OnClick()
			{
				if (mb.getResult() == DWMessageBox.SOFTKEY_OK) {
					m_stFrame.removeControl(mb);
					Tools.debugPrintln("确定");
					DWGameManager.writeSettingToProperties(DWGameManager.PROPERTIES_DIR);
					DWGameManager.getInstance().showToast("您的修改已经保存。", Toast.LENGTH_SHORT);
				}
				else if (mb.getResult() == DWMessageBox.SOFTKEY_BACK) {
					m_stFrame.removeControl(mb);
					Tools.debugPrintln("返回");
				}
			}
		});
		m_stFrame.addControl(mb);
	}

	/**
	 * 修复游戏提示
	 */
	public void xiufuyouxi()
	{
		final DWMessageBox mb = new DWMessageBox("游戏设置", "是否确定要修复游戏？");
		mb.addListener(new DWListener() {
			public void OnDoubleClick()
			{
			}

			public void OnClick()
			{
				if (mb.getResult() == DWMessageBox.SOFTKEY_OK) {
					m_stFrame.removeControl(mb);
					Tools.debugPrintln("确定");
				}
				else if (mb.getResult() == DWMessageBox.SOFTKEY_BACK) {
					m_stFrame.removeControl(mb);
					Tools.debugPrintln("返回");
				}
			}
		});
		m_stFrame.addControl(mb);
	}

	/**
	 * 保存修改
	 */
	private DWListener m_stBp16 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			tishi01();
		}
	};

	/**
	 * 保存修改(登陆界面)
	 */
	private DWListener m_stBp16_01 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			tishi02();
		}
	};

	/**
	 * 修复游戏
	 */
	private DWListener m_stBp18 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			xiufuyouxi();
		}
	};

	/**
	 * 返回监听(登陆界面)
	 */
	private DWListener m_back_lis = new DWListener() {
		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWControlsManager.getInstance().removeAllControl();
			Login login = new Login();
			login.setNextStatus(Login.STATUS_MAIN);
			login.m_input_box_1 = login.m_setup_ib1;
			login.m_input_box_2 = login.m_setup_ib2;
			login.m_check_box_flag = login.m_setup_flag;
			Loading.s_progress = 0;

			DWGameManager.getInstance().setGameHandler(login);

			DWGameManager.getInstance().setGameState(DWGameManager.GS_LOGIN);

			close((byte) 0);
		}
	};

	/**
	 * 脱离卡死监听
	 */
	private DWListener m_stBp21 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			if (DWGameManager.getInstance().m_role.isSellStatus()) {
				DWGameManager.getInstance().addSystemInfo(
						DWGameManager.SYSTEM_INFO_TYPE_B, "摆摊中，无法操作！");
				return;
			}
			DWGameManager.getInstance().getSendMessage().sendUserTuoli();
		}
	};

	/**
	 * 游戏帮助监听
	 */
	private DWListener m_stBp22 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			final DWMessageBox mb = new DWMessageBox("游戏帮助", "想了解更多的详情，请直接登陆我们的官网"
					+ DWControlTools.CHANGE_ROW
					+ "地址：3gmax.cn"
					+ DWControlTools.CHANGE_ROW
					+ "联系电话：400-061-1230");
			mb.addListener(new DWListener() {
				public void OnDoubleClick()
				{

				}

				public void OnClick()
				{
					if (mb.getResult() == DWMessageBox.SOFTKEY_OK) {
						Tools.debugPrintln("确定");
						DWControlsManager.getInstance().removeControl(mb);
					}
					else if (mb.getResult() == DWMessageBox.SOFTKEY_BACK) {
						Tools.debugPrintln("返回");
						DWControlsManager.getInstance().removeControl(mb);
					}
				}
			});
			DWControlsManager.getInstance().addControl(mb);
		}
	};

	/**
	 * 游戏公告监听
	 */
	private DWListener m_stBp23 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.getInstance().getSendMessage().sendAnnouncement();
			DWControlsManager.getInstance().removeControl(m_stFrame);
		}
	};

	/**
	 * 切换角色监听
	 */
	private DWListener m_stBp24 = new DWListener() {

		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			DWGameManager.getInstance().getSendMessage().sendReSel();
		}
	};

	/**
	 * 退出游戏监听
	 */
	private DWListener m_stBp25 = new DWListener() {
		public void OnDoubleClick()
		{
		}

		public void OnClick()
		{
			final DWMessageBox mb = new DWMessageBox("提示", "您确定要退出?");
			mb.addListener(new DWListener() {
				public void OnDoubleClick()
				{
				}

				public void OnClick()
				{
					if (mb.getResult() == DWMessageBox.SOFTKEY_OK) {
						Tools.debugPrintln("确定");
						DWControlsManager.getInstance().removeControl(mb);
						DWGameManager.getInstance().destroy();
					}
					else if (mb.getResult() == DWMessageBox.SOFTKEY_BACK) {
						Tools.debugPrintln("返回");
						DWControlsManager.getInstance().removeControl(mb);
					}
				}
			});
			DWControlsManager.getInstance().addControl(mb);
		}
	};

	/**
	 * 联系客服监听
	 */
	public Boolean m_flag_setup;
	private DWListener m_stBp26 = new DWListener() {
		public void OnDoubleClick()
		{

		}

		public void OnClick()
		{
			if (DWGameManager.getInstance().m_role.isSellStatus()) {
				DWGameManager.getInstance().addSystemInfo(
						DWGameManager.SYSTEM_INFO_TYPE_B, "摆摊中，无法操作！");
				return;
			}
			UIWindows.getInstance().m_mail.open((byte) 0);
			UIWindows.getInstance().m_mail.m_tabcontrol.setSelectPage(2);
			DWControlsManager.getInstance().removeControl(m_stFrame);
		}
	};

	public void open(byte index)
	{
		state = index;
		setup();
		switch (state) {
			case 0:
				boolean sjpd = DWGameManager.getSetting_system(DWGameManager.设置系统_世界频道);
				if (sjpd == true) {
					m_stButton01.setBackground(m_stBitmap02, false);
					m_stButton02.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton01.setBackground(m_stBitmap03, false);
					m_stButton02.setBackground(m_stBitmap02, false);
				}
				boolean jzpd = DWGameManager.getSetting_system(DWGameManager.设置系统_家族频道);
				if (jzpd == true) {
					m_stButton03.setBackground(m_stBitmap02, false);
					m_stButton04.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton03.setBackground(m_stBitmap03, false);
					m_stButton04.setBackground(m_stBitmap02, false);
				}
				boolean dwpd = DWGameManager.getSetting_system(DWGameManager.设置系统_队伍频道);
				if (dwpd == true) {
					m_stButton05.setBackground(m_stBitmap02, false);
					m_stButton06.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton05.setBackground(m_stBitmap03, false);
					m_stButton06.setBackground(m_stBitmap02, false);
				}
				boolean slpd = DWGameManager.getSetting_system(DWGameManager.设置系统_私聊频道);
				if (slpd == true) {
					m_stButton07.setBackground(m_stBitmap02, false);
					m_stButton08.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton07.setBackground(m_stBitmap03, false);
					m_stButton08.setBackground(m_stBitmap02, false);
				}
				boolean zypd = DWGameManager.getSetting_system(DWGameManager.设置系统_阵营频道);
				if (zypd == true) {
					m_stButton09.setBackground(m_stBitmap02, false);
					m_stButton10.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton09.setBackground(m_stBitmap03, false);
					m_stButton10.setBackground(m_stBitmap02, false);
				}
				boolean yxyy = DWGameManager.getSetting_system(DWGameManager.设置系统_游戏音乐);
				if (yxyy == true) {
					m_stButton12.setBackground(m_stBitmap02, false);
					m_stButton13.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton12.setBackground(m_stBitmap03, false);
					m_stButton13.setBackground(m_stBitmap02, false);
				}
				boolean yxyx = DWGameManager.getSetting_system(DWGameManager.设置系统_游戏音效);
				if (yxyx == true) {
					m_stButton14.setBackground(m_stBitmap02, false);
					m_stButton15.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton14.setBackground(m_stBitmap03, false);
					m_stButton15.setBackground(m_stBitmap02, false);
				}
				break;
			case 1:
				boolean sjpd02 = DWGameManager.getSetting_system(DWGameManager.设置系统_世界频道);
				if (sjpd02 == true) {
					m_stButton01.setBackground(m_stBitmap02, false);
					m_stButton02.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton01.setBackground(m_stBitmap03, false);
					m_stButton02.setBackground(m_stBitmap02, false);
				}
				boolean jzpd02 = DWGameManager.getSetting_system(DWGameManager.设置系统_家族频道);
				if (jzpd02 == true) {
					m_stButton03.setBackground(m_stBitmap02, false);
					m_stButton04.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton03.setBackground(m_stBitmap03, false);
					m_stButton04.setBackground(m_stBitmap02, false);
				}
				boolean dwpd02 = DWGameManager.getSetting_system(DWGameManager.设置系统_队伍频道);
				if (dwpd02 == true) {
					m_stButton05.setBackground(m_stBitmap02, false);
					m_stButton06.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton05.setBackground(m_stBitmap03, false);
					m_stButton06.setBackground(m_stBitmap02, false);
				}
				boolean slpd02 = DWGameManager.getSetting_system(DWGameManager.设置系统_私聊频道);
				if (slpd02 == true) {
					m_stButton07.setBackground(m_stBitmap02, false);
					m_stButton08.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton07.setBackground(m_stBitmap03, false);
					m_stButton08.setBackground(m_stBitmap02, false);
				}
				boolean zypd02 = DWGameManager.getSetting_system(DWGameManager.设置系统_阵营频道);
				if (zypd02 == true) {
					m_stButton09.setBackground(m_stBitmap02, false);
					m_stButton10.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton09.setBackground(m_stBitmap03, false);
					m_stButton10.setBackground(m_stBitmap02, false);
				}
				boolean tqxg02 = DWGameManager.getSetting_system(DWGameManager.设置系统_游戏音乐);
				if (tqxg02 == true) {
					m_stButton12.setBackground(m_stBitmap02, false);
					m_stButton13.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton12.setBackground(m_stBitmap03, false);
					m_stButton13.setBackground(m_stBitmap02, false);
				}
				boolean yxsy02 = DWGameManager.getSetting_system(DWGameManager.设置系统_游戏音效);
				if (yxsy02 == true) {
					m_stButton14.setBackground(m_stBitmap02, false);
					m_stButton15.setBackground(m_stBitmap03, false);
				}
				else {
					m_stButton14.setBackground(m_stBitmap03, false);
					m_stButton15.setBackground(m_stBitmap02, false);
				}
				boolean dfwj02 = DWGameManager.getSetting_graphics(DWGameManager.设置画面_显示敌方玩家);
				if (dfwj02 == true) {
					m_hmButton01.setBackground(m_stBitmap02, false);
					m_hmButton02.setBackground(m_stBitmap03, false);
				}
				else {
					m_hmButton01.setBackground(m_stBitmap03, false);
					m_hmButton02.setBackground(m_stBitmap02, false);
				}
				boolean yfwj02 = DWGameManager.getSetting_graphics(DWGameManager.设置画面_显示友方玩家);
				if (yfwj02 == true) {
					m_hmButton03.setBackground(m_stBitmap02, false);
					m_hmButton04.setBackground(m_stBitmap03, false);
				}
				else {
					m_hmButton03.setBackground(m_stBitmap03, false);
					m_hmButton04.setBackground(m_stBitmap02, false);
				}
				boolean qtwjmc02 = DWGameManager.getSetting_graphics(DWGameManager.设置画面_显示其他玩家名称);
				if (qtwjmc02 == true) {
					m_hmButton05.setBackground(m_stBitmap02, false);
					m_hmButton06.setBackground(m_stBitmap03, false);
				}
				else {
					m_hmButton05.setBackground(m_stBitmap03, false);
					m_hmButton06.setBackground(m_stBitmap02, false);
				}
				boolean qtwjtx02 = DWGameManager.getSetting_graphics(DWGameManager.设置画面_显示其他玩家特效);
				if (qtwjtx02 == true) {
					m_hmButton07.setBackground(m_stBitmap02, false);
					m_hmButton08.setBackground(m_stBitmap03, false);
				}
				else {
					m_hmButton07.setBackground(m_stBitmap03, false);
					m_hmButton08.setBackground(m_stBitmap02, false);
				}
				m_hmTextbox05.setText("屏幕亮度：" + (DWGameManager.getSetting_light() / 2 - 10));
				m_stSlider.setCurrentValue(DWGameManager.getSetting_light() - 20);
				break;
		}
	}

	public void close(byte index)
	{
		DWControlsManager.getInstance().removeControl(m_stFrame);
	}

	public void dispose()
	{

	}

	public void logic()
	{

	}

	/**
	 * mujianchen 切换角色
	 *
	 * @param dis
	 * @throws IOException
	 */
	public void recvChangeRole(DataInputStream dis) throws IOException
	{

		DWControlsManager.getInstance().removeAllControl();

		Login login = new Login();

		login.setNextStatus(Login.STATUS_ROLES);

		login.setNextStatus(Login.STATUS_ROLES);

		DWGameManager.s_change_role = true;
		Loading.s_progress = 0;

		DWGameManager.getInstance().setGameHandler(login);

		DWGameManager.getInstance().setGameState(DWGameManager.GS_LOGIN);

		UIFamilyWindow.m_isFirstOpenSkill = true;
	}

}
